package Homeworks.HOMEWORK0320.BirthdayPassed;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws ParseException {

        Scanner sc=new Scanner(System.in);
        System.out.println("输入生日yyyy-mm-dd");
        String birthday=sc.nextLine();

        String pattern="yyyy-mm-dd";
        SimpleDateFormat sdf=new SimpleDateFormat(pattern);

        Date birthdayDate =sdf.parse(birthday);
        long birthdayDateTime=birthdayDate.getTime();

        long todayTime=new Date().getTime();

        long time=todayTime-birthdayDateTime;

        System.out.println("已出生"+time/1000/3600/24+"天");
    }
}
